﻿using System;
using System.Drawing;
using System.Web.Services;
using Arizu.Repository;
using System.Drawing.Imaging;
using Arizu.Entity;
using System.Data;
using AiRiZu.User;

namespace AiRiZu.user.dashboard
{
    public partial class DashBoard : Common
    {
        public string TeSeimgurl = "images/default_user_pic.png";

        protected void Page_Load(object sender, EventArgs e)
        {
            AirizuUser userDao = AirizuUser.CreateInstance();
            int userId = -1;
            if (Session["logId"] != null)
            {
                userId = int.Parse(Session["logId"].ToString());
                DataTable dt = userDao.GetUser(userId);

                if (dt.Rows.Count > 0)
                {
                    if (string.IsNullOrEmpty(dt.Rows[0]["Image"].ToString()))
                    {
                        TeSeimgurl = "images/default_user_pic.png";
                    }
                    else
                    {
                        TeSeimgurl = Constants.IMGURL + dt.Rows[0]["Image"].ToString();
                    }
                }
                
                
            }
            
        }

        protected void logoutButton_Click(object sender, EventArgs e)
        {
            Session.Clear();
            Response.Redirect(Request.Url.ToString()); 
        }

    }
}
